<?php

class UserEquity extends BaseModel
{
    public $res;
    public $expire;

    public function getSource()
    {
        return "f_user_equity";
    }

    public function get_list($level_id = 0)
    {
        $where['conditions'] = "";
        if ($level_id > 0) {
            $where['conditions'] = "level_id = $level_id";
        }
        $data = $this->find($where);
        return $data->toarray();
    }

    public function get_level_list($level_id)
    {
        $level_id                = ($level_id + 1) > 3 ? 3 : $level_id + 1;
        $condition['conditions'] = "level_id = $level_id";
        $condition['order']      = 'sort asc';
        return $this->find($condition)->toarray();
    }

}
